<?php
/**
 * Created by PhpStorm.
 * User: mj
 * Date: 17-7-4
 * Time: 上午11:22
 */

namespace Mjrnamei\SwooleHttp\Console;


abstract class Input implements InputInterface
{

    private $args = [];

    public function __construct()
    {
        // todo
    }

    public function getFirstArgument()
    {
        if(is_array($this->args)){
            return $this->args[0];
        }elseif(is_string($this->args)){
            return $this->args ;
        }else{
            return null ;
        }
    }

    public function getArguments()
    {
        return $this->args ;
    }

    public function getArgument($name)
    {
        return $this->args[$name] ?? null ;
    }

    public function setArgument($name, $value)
    {
        $this->args[$name] = $value ;
    }

    public function hasArgument($name)
    {
        return array_key_exists($name ,$this->args);
    }

    public function getOptions()
    {
        // TODO: Implement getOptions() method.
    }

    public function getOption($name)
    {
        // TODO: Implement getOption() method.
    }

    public function setOption($name, $value)
    {
        // TODO: Implement setOption() method.
    }

    public function hasOption($name)
    {
        // TODO: Implement hasOption() method.
    }

    abstract public function parse();
}
